﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using QzEbook.Common;
using System.Data.Common;

namespace QzEbook.AccessObject
{
    /// <summary>
    /// 用于收集访问此电子书的用户群,这个功能可能会收集到一堆的拉圾信息;
    /// </summary>
    public class ViewGuest : abstractAccess<ViewGuest>
    {
        private int bookId;

        public int BookId
        {
            get { return bookId; }
            set { bookId = value; }
        }
        private string ip;

        public string Ip
        {
            get { return ip; }
            set { ip = value; }
        }
        private string urlRaw;

        public string UrlRaw
        {
            get { return urlRaw; }
            set { urlRaw = value; }
        }

        public ViewGuest()
        {
        }

        /// <summary>
        /// 插入记录;
        /// </summary>
        /// <returns></returns>
        public override bool insert()
        {
            DbCommand command = CreateCommand("InsertViewGuest");
            addParameter(command, "BID", BookId);
            addParameter(command, "GIp", Ip);
            addParameter(command, "GUrlRaw", UrlRaw);
            return (DataAccess.ExecuteNonQuery(command) != -1);
        }

        protected override ViewGuest bindRow(DataRow row)
        {
            throw new NotImplementedException();
        }

        protected override DataTable selectTable()
        {
            throw new NotImplementedException();
        }
    }

}